package com.quasar.hpatient.presenter;

import com.quasar.hpatient.model.httpmodel.AnotherResult;
import com.quasar.hpatient.model.medicalmodel.DoctorEventData;
import com.quasar.hpatient.model.requestmodel.RequestModel;
import com.quasar.hpatient.onInterface.AnotherResultListener;
import com.quasar.hpatient.onInterface.OnDoctorEventListener;

/**
 * author : 许建宏
 * Date: 2018/1/6 0006
 * View:
 */

public class DoctorEventPresenter {

    private RequestModel requestModel;
    private OnDoctorEventListener onDoctorListener;

    public DoctorEventPresenter(OnDoctorEventListener onDoctorListener) {
        this.requestModel = new RequestModel();
        this.onDoctorListener = onDoctorListener;
    }


    //获取医生添加的事件
    public void  GetPatientSingleInspectionEventData(String recordTime,String endTime){

        requestModel.GetPatientSingleInspectionEvent(recordTime, endTime, new AnotherResultListener<AnotherResult<DoctorEventData>>() {
            @Override
            public void onSuccess(AnotherResult<DoctorEventData> data) {
                onDoctorListener.onDoctorEventSuccess(data);
            }

            @Override
            public void onError(String msg) {
                onDoctorListener.onDoctorEventError(msg);
            }

            @Override
            public void onRefreshUI() {
                onDoctorListener.onDoctorEventRefreshUI();
            }
        });
    }

}
